From: Daniel van Vugt Date: Fri, 12 Mar 2021 06:45:19 +0000 (+0800) Subject: keyboard: Handle symbolic OSK key codes as explicitly invalid X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~103 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1f0e4b58ab1af96840475896e2fe9409468b5be0;p=gnome-shell.git keyboard: Handle symbolic OSK key codes as explicitly invalid `key` is an empty string in this case, causing `charCodeAt(0)` to return `NaN`, which when passed to `Clutter.unicode_to_keysym` now generates an error in gjs >= 1.67.3: ``` JS ERROR: Error: Argument wc: value is out of range for uint32 ``` And the symbolic keys like Backspace, Enter and Caps Lock would have their presses ignored. Just skip the call to `charCodeAt` that will fail and allow `Clutter.unicode_to_keysym` to return its usual error flag. Fixes: https://bugs.launchpad.net/bugs/1918738 Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 7452feaac..866382e4f 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -327,7 +327,7 @@ var Key = GObject.registerClass({ } _getKeyval(key) { - let unicode = key.charCodeAt(0); + let unicode = key.length ? key.charCodeAt(0) : undefined; return Clutter.unicode_to_keysym(unicode); }